<include file="default/public/header_common" />
<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{&quot;directionNav&quot;:false}' style="height:320px; overflow:hidden;">
  <ul class="am-slides">
    <volist name="goods['pics']" id="vo">
      <li> <img src="/{$vo['goodsImg']}"> </li>
    </volist>
  </ul>
</div>
<div class="am-container item-box mb-1">
  <ul class="am-list am-list-static am-list-nb">
    <li>{$goods['goodsName']}</li>
    <li><span class="bl pl-1 am-fr c-999">
      <if condition="$goods['isFollow']"><i class="am-icon-star collect-b" style="color:#F37B1D;"></i> 已关注
        <else />
        <a href="javascript:followGoods({$goods['goodsId']});" style="color:#999;"><i class="am-icon-star collect-b" style="color:#F37B1D;"></i> 关注</a></if>
      </span> 合作价：<span class="c-red">{$goods['shopPrice']}</span> <del class="f-small">{$goods['marketPrice']}</del></li>
    <li>库存量：{$goods['goodsStock']}</li>
  </ul>
</div>
<div class="am-container item-box mb-1">
  <ul class="am-list am-list-static am-list-nb">
    <li style="border:none;"><a href="{:U('Wap/shopsIndex/newGoodsList/shopId/' . $goods['shopId'])}" class="am-fr c-999" style="padding-top: 0.5rem;">查看店铺</a> <img src="<if condition="empty($goods['shopImg'])">__ROOT__/Apps/Wap/View/default/assets/i/yudo.png
      <else />
      /{$goods['shopImg']}
      </if>
      " class="am-circle" width="40" height="40px;"> {$goods.shopName}</li>
  </ul>
</div>
<div data-am-widget="tabs" class="am-tabs am-tabs-d2 mg-0">
  <ul class="am-tabs-nav am-cf">
    <li class="am-active"><a href="[data-tab-panel-0]">宝贝信息</a></li>
    <li class=""><a href="[data-tab-panel-1]">宝贝评价</a></li>
  </ul>
  <div class="am-tabs-bd">
    <div data-tab-panel-0 class="am-tab-panel am-active">
      <h2 class="titlebar"> <img src="__ROOT__/Apps/Wap/View/default/assets/i/icon-tit.png"> 宝贝详情 </h2>
      <ul class="pro-info">
        <if condition="!empty($goods['className'])"><li><span class="pi-name">种质：</span>
          <p>{$goods['className']}</p>
        </li></if>
        <if condition="!empty($goods['catName'])"><li><span class="pi-name">款式：</span>
          <p>{$goods['catName']}</p>
        </li></if>
        <if condition="!empty($goods['goodsSize'])"><li><span class="pi-name">尺寸：</span>
          <p>{$goods['goodsSize']}</p>
        </li></if>
        <if condition="!empty($goods['goodsWeight'])"><li><span class="pi-name">重量：</span>
          <p>{$goods['goodsWeight']}</p>
        </li></if>
      </ul>
      <p>{$goods['goodsContent']}</p>
      <if condition="!empty($goods['goodsVedio'])">
      <link href="__PUBLIC__/css/video-js.css" rel="stylesheet">
      <script src="__PUBLIC__/js/video.js"></script>
      <video id="my-video" class="video-js" controls preload="auto" poster="" data-setup="{}">
        <source src="http://m.yushangcn.com/{$goods['goodsVedio']}" type='video/mp4'>
      </video>
      <script src="dist/video.js"></script>
      <style class="vjs-styles-dimensions">
		.my-video-dimensions {width: 100% !important;height: 230px !important;}
		.my-video-dimensions.vjs-fluid {padding-top: 41.66666666666667%;}
	  </style>
      </if>
      <h2 class="titlebar"> <img src="__ROOT__/Apps/Wap/View/default/assets/i/icon-tit.png"> 图片展示 </h2>
      <article data-am-widget="paragraph" class="am-paragraph am-paragraph-default mg-0" data-am-paragraph="{ tableScrollable: true, pureview: true }">
        <volist name="goods['pics']" id="vo"> <img src="/{$vo['goodsImg']}"> </volist>
      </article>
    </div>
    <div data-tab-panel-1 class="am-tab-panel ">
      <ul class="am-comments-list am-comments-list-flip" id="showComment">
      </ul>
    </div>
  </div>
</div>
<div data-am-widget="navbar" class="am-navbar am-cf navbar-bottom"	 id="">
  <ul class="am-navbar-nav am-cf am-avg-sm-3">
    <li >
      <button type="button" class="am-btn am-btn-default am-radius am-btn-sm" data-am-modal="{target: '#doc-modal-1'}">联系卖家</button>
    </li>
    <li >
      <button type="button" class="am-btn am-btn-danger am-radius am-btn-sm" onClick="addToCart({$goods.goodsId})">立即购买</button>
    </li>
  </ul>
</div>
<div data-am-widget="gotop" class="am-gotop am-gotop-fixed" > <a href="#top" title=""> <img class="am-gotop-icon-custom" src="__ROOT__/Apps/Wap/View/default/assets/i/i-top.png" /> </a> </div>
<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-1">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">拨打电话 <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a> </div>
    <div class="am-modal-bd" style="margin-top:8px;"> 拨号呼叫：{$goods.shopTel}<br>
      <br>
      <a href="Tel:{$goods.shopTel}">
      <button type="button" class="am-btn am-btn-danger">呼叫</button>
      </a> </div>
  </div>
</div>
<script src="__ROOT__/Apps/Wap/View/default/assets/js/jquery.min.js"></script> 
<script src="__ROOT__/Apps/Wap/View/default/assets/js/amazeui.min.js"></script> 
<script src="__PUBLIC__/js/common.js"></script> 
<script type="text/javascript">
function addToCart(id) {
	$.post("{:U('Wap/Cart/addToCart')}",{goodsId:id},function(data,textStatus){
		var json = MXC.toJson(data);
		if(json.code == 1) {
			window.location = "{:U('Wap/Order/checkOrder')}?cartId=" + json.data.cartId;
		} else if(json.code == '100001') { 
			alert(json.info);
			window.location = "{:U('Wap/Users/login')}";
		} else {
			alert(json.info);
		}
	});
}
function followGoods(id) {
	$.post("{:U('Wap/Users/followGoods')}",{goodsId:id},function(data,textStatus){
		var json = MXC.toJson(data);
		if(json.code == 1) {
			alert('关注成功！');
			location.reload();
		} else if(json.code == '100001') { 
			alert(json.info);
			window.location = "{:U('Wap/Users/login')}";
		} else {
			alert(json.info);
		}
	});
}

var url = "{:U('Wap/Index/goodsComment')}"
showComment();
function showComment() {
	var params = {};
	params.id = "{$goods['goodsId']}";
	params.num = 5;
	params.page = 1;
	$.post(url,params,function(data){
		$("#showComment").html(data);
	});
}
function nextPage() {
	var params = {};
	params.id = "{$goods['goodsId']}";
	params.num = 5;
	params.page = Number($("#current").val()) + 1;
	$.post(url,params,function(data){
		$("#showComment").html(data);
	});
}
function prevPage() {
	var params = {};
	params.id = "{$goods['goodsId']}";
	params.num = 5;
	params.page = Number($("#current").val()) - 1;
	$.post(url,params,function(data){
		$("#showComment").html(data);
	});
}
</script>
</body></html>